#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	unordered_map<string, int> mp = {
		{"Jan", 1}, {"Feb", 2}, {"Mar", 3}, {"Apr", 4},
		{"May", 5}, {"Jun", 6}, {"Jul", 7}, {"Aug", 8},
		{"Sep", 9}, {"Oct", 10}, {"Nov", 11}, {"Dec", 12}
	};

	string s;
	cin >> s;

	cout << mp[s.substr(0, 3)] << " " << stoi(s.substr(3));
	return 0;
}
